#include <iostream>
using namespace std;
int a,c[100001];
int fffjh(int v,int k)
{
    int x=c[v];
    c[v]=c[k];
    c[k]=x;
}
void ppxx()
{
    int maaax;
    for(int i=1;i<=a;i++)
    {
        maaax=i;
        for(int j=i;j<=a;j++)
        {
            if(c[maaax]>c[j])
                maaax=j;
        }
        fffjh(maaax,i);
    }
}
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>a;
    for(int i=1;i<=a;i++)
    {

        cin>>c[i];
    }
    ppxx();
    int ws=0,x,kg=0,tjshm=0;
    x=c[1];
    for(int i=1;i<=a;i++)
    {
        if(c[i]==x)
        {
            if(tjshm==0)
                ws++;
            else
                kg++;
        }
        else
        {
            if(tjshm==0)
            {
                tjshm=1;
                kg++;
            }
            else
            {
                if(ws<kg)
                    ws=kg;
                kg=1;
            }

        }
    }
    if(ws<kg)
        ws=kg;
    cout<<ws;
    return 0;
}
